<ul class="bx-slideshow">
<?php
  $attachments = attachments_get_attachments();
  if ($attachments) {
  foreach($attachments as $attachment){
  // print_r($attachment);
  $mime = split('/',$attachment['mime']);
  $mime = $mime[0];
  
  if($attachment){
?>
  <li>
    <?php if($mime == 'video'){ ?>
      <?php echo do_shortcode('[video mp4="'.$attachment['location'].'" width="560" height="375"]'); ?>
    <?php }else{ ?>
      <img class="group" src="<?php echo $attachment['location'] ?>" />
    <?php } ?>
  </li>
<?php }}} ?>
</ul>

<p><?php echo $post->post_title; ?> | <span id="bx-pager"></span> | <?php echo $post->post_content; ?></p>

<script>
  $(document).ready(function(){
    $(document).bind('cbox_complete', function(){
			$('#bx-pager').html('');
			if(global){
				global.destroyShow();
			}
		
      if($('.bx-slideshow li').length > 0){
        global = $('.bx-slideshow').bxSlider({
          prevText: '',
          nextText: '',
          pager: true,
          pagerType: 'short',
          pagerSelector: '#bx-pager',
          pagerShortSeparator: ' of '
        });
      }
      $.colorbox.resize();
    });
  });
</script>